package org.devbg.academy.corejava.shop.ui.models;

import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;

public class CategorySelectionListener implements TreeSelectionListener {

	public void valueChanged(TreeSelectionEvent event) {
		Object lastElement = event.getPath().getLastPathComponent();
		if (lastElement instanceof CategoryTreeNode) {
			CategoryTreeNode node = (CategoryTreeNode) lastElement;
			System.out.println(node.getUserObject());
		}

	}

}
